package com.js.study.datastructs.stack;

import java.util.Stack;

/**
 * @Author JiangSen
 * @DATE 2023/12/27 11:30
 */
public class let20 {
    private Boolean kh(char[] ch){
        Stack<Character> stack = new Stack<>();
        int leng = ch.length;
        for (int i = 0; i < leng; i++) {
            if(ch[i] == '(' ||ch[i]== '[' || ch[i] == '{'){
                stack.push(ch[i]);
            } else if (!stack.isEmpty()) {
                if (stack.peek().equals('(') && ')'==ch[i]) {
                    stack.pop();
                }else if (stack.peek().equals('{') && '}'==ch[i]){
                    stack.pop();
                }else if (stack.peek().equals('[') && ']'==ch[i]){
                    stack.pop();
                }
            }else{
                return false;
            }
        }
       return stack.isEmpty()?true:false;
    }
    public static void main(String[] args) {
        String a =null;
        char[] chars = a.toCharArray();


    }
}

